import type { App } from "vue";
import { useUserInfoStore } from "@/stores/userInfo";
const UserInfoState = useUserInfoStore();
export default function has(app: App) {
  app.directive("has", {
    mounted(el, binding) {
      if (!UserInfoState.buttons.includes(binding.value)) {
        el.parentNode.removeChild(el);
      }
    }
  });
}